{include file="public/head"/} 
  <body>
    
    <div class="x-body" style="width:50%;margin:0 auto">
      <div style="height:60px;line-height: 60px;font-size:30px">
        设备拍照注册
      </div>
      <div style="height:60px;line-height: 60px;font-size:16px">
        人员姓名:{$userinfo.name},&nbsp;&nbsp;地址:{$userinfo.building}幢{$userinfo.unit}单元{$userinfo.room}室
      </div>
      <div style="height:40px;line-height: 40px;font-size:16px">
        需要注册的设备
      </div>
     
      <table class="layui-table">
        <thead>
          <tr>
            <th>门锁名称</th>
            <th>序列号</th>
            <th>设备状态</th>
            <th>设备网络状态</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>{$deviceinfo.devicename}</td>
            <td>{$deviceinfo.devicekey}</td>
            <td>
              {if $deviceinfo.state == 1}
                  未绑定
              {elseif $deviceinfo.state == 2}
                  绑定中
              {elseif $deviceinfo.state == 3}
                  解绑中
              {elseif $deviceinfo.state == 4}
                  未同步
              {elseif $deviceinfo.state == 5}
                  同步中
              {elseif $deviceinfo.state == 6}
                  已同步
              {elseif $deviceinfo.state == 7}
                  已禁用
              {elseif $deviceinfo.state == 8}
                  禁用中
              {elseif $deviceinfo.state == 9}
                  启用中
              {/if}
            </td>
            <td>
              {if $deviceinfo.status == 1}
                  在线
              {elseif $deviceinfo.status == 2}
                  离线
              {/if}
            </td> 
          </tr>
        </tbody>
      </table>
      <div class="layui-form-item">
          <label for="L_repass" class="layui-form-label">
          </label>
          <button  class="layui-btn" lay-filter="add" lay-submit="" onclick="photo()">
              确定
          </button>
      </div>
      <div class="page">
        <div>
         
        </div>
      </div>

    </div>
    
    <script type="text/javascript">
      //设备拍照
      function photo(){
        var personGuid='{$userinfo.personGuid}';
        var devicekey='{$deviceinfo.devicekey}';
        $.post('{:url("devicephoto")}', {personGuid: personGuid,devicekey:devicekey}, function(r){
          console.log(r);
        })
        
        
      }
    </script>
    <script>
      var _hmt = _hmt || []; (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
  </body>

</html>